import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  strict: true,
  state: {
    token: localStorage.getItem('token') || '',
    refreshtoken: localStorage.getItem('refresh_token') || ''
  },
  mutations: {
    settoken (state, tokenStr) {
      state.token = tokenStr
      localStorage.setItem('token', tokenStr)
    },
    setrefreshtoken (state, refreshtokenStr) {
      state.refreshtoken = refreshtokenStr
      localStorage.setItem('refresh_token', refreshtokenStr)
    }
  },
  actions: {
  },
  modules: {
  }
})
